public class MoneyNumInputView extends RelativeLayout {
	
	//输入金额的虚拟键盘
 
    Context context;
    private GridView gridView;
    private ArrayList<Map<String, String>> valueList;
    private RelativeLayout layoutBack;

    public MoneyNumInputView(Context context) {
        this(context, null);
    }

	//标准ViewGroup构造函数
    public VirtualKeyboardView(Context context, AttributeSet attrs) {
        super(context, attrs);
        this.context = context;
        View view = View.inflate(context, R.layout.layout_virtual_keyboard, null);
        valueList = new ArrayList<>();
        layoutBack = (RelativeLayout) view.findViewById(R.id.layoutBack);
        gridView = (GridView) view.findViewById(R.id.gv_keybord);
		
		// 初始化map按键内容
        for (int i = 1; i < 13; i++) {
            Map<String, String> map = new HashMap<>();
            if (i < 10) {
                map.put("name", String.valueOf(i));
            } else if (i == 10) {
                map.put("name", ".");
            } else if (i == 11) {
                map.put("name", String.valueOf(0));
            } else if (i == 12) {
                map.put("name", "");
            }
            valueList.add(map);
        }
		
		//对girdView设置展示内容adapter
		MoneyNumAdapter keyBoardAdapter = new MoneyNumAdapter(context, valueList);
        gridView.setAdapter(keyBoardAdapter);
		
		//标准addView
        addView(view);
    }

    public RelativeLayout getLayoutBack() {
        return layoutBack;
    }

    public ArrayList<Map<String, String>> getValueList() {
        return valueList;
    }

    public GridView getGridView() {
        return gridView;
    }
}

